package com.zy.utils;

import java.util.List;

public class LimitUtil {//分页辅助类
	//属性
	//页面尺寸----->自己规定的
	private Integer pageSize=3;
    //总条数------->从数据库查询的（SELECT COUNT(*) from t_customer）
	private Integer totalCount;
	//总页数------->总页数int c=(a%b==0?(a/b):(a/b)+1);
	private Integer pageCount;
	//当前页 ------->页面传入的参数
	private Integer currentPage;
	//查询出来的数据集合 ?不确定：增强扩展性
	private List<?> data;
	
	
	
	public LimitUtil() {
		super();
	}
	public LimitUtil(Integer pageSize, Integer totalCount, Integer pageCount, Integer currentPage, List<?> data) {
		super();
		this.pageSize = pageSize;
		this.totalCount = totalCount;
		this.pageCount = pageCount;
		this.currentPage = currentPage;
		this.data = data;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	//-------------------------------------
	//修改该get方法
	public Integer getPageCount() {
		//总页数int c=(a%b==0?(a/b):(a/b)+1);	
		pageCount=(totalCount%pageSize==0?(totalCount/pageSize):(totalCount/pageSize)+1);
		return pageCount;
	}
	//-----------------------------------------
	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}
	public Integer getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}
	public List<?> getData() {
		return data;
	}
	public void setData(List<?> data) {
		this.data = data;
	}
	
	
	
	
	
	
	
	
	
	
	
	
}
